package com.hontech.bv.model

import com.hontech.bv.codec.toHex4
import com.hontech.bv.conn.Proto
import com.hontech.bv.conn.api.Heat
import com.hontech.bv.model.arm.ArmStatus
import com.hontech.bv.model.heat.HeatStatus
import com.hontech.bv.model.ice.IceStatus
import com.hontech.bv.model.pearl.PearlStatus
import com.hontech.bv.model.pick.PickStatus
import com.hontech.bv.model.pipe_line.PipeLineStatus
import com.hontech.bv.model.powder.PowderStatus
import com.hontech.bv.utils.Version
import okhttp3.internal.toHexString

object Version {

    fun getVerByDest(dest: Int): String {
        return when (dest) {
            Proto.ID_MASTER -> PipeLineStatus.status.appVersion.value.toHex4()
            Proto.ID_ICE -> IceStatus.status.appVersion.value.toHex4()
            Proto.ID_PICK -> PickStatus.status.appVersion.value.toHex4()
            Proto.ID_HEAT -> HeatStatus.status.appVersion.value.toHex4()
            Proto.ID_ARM -> ArmStatus.status.appVersion.value.toHex4()
            Proto.ID_POWDER -> PowderStatus.status.appVersion.value.toHex4()
            Proto.ID_PEARL -> PearlStatus.status.appVersion.value.toHex4()
            Proto.ID_IPC -> Version
            else -> throw IllegalStateException("未知的设备")
        }
    }
}